﻿using FashionWebsite.Models;
using FashionWebsite.Models.DAL;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace FashionWebsite.Controllers
{
    public class CategoryController : Controller
    {
        //
        // GET: /Category/
        private DalCategory ProductCatelogy = new DalCategory();
        ShopOnlineDataContext data = new ShopOnlineDataContext();
        public ActionResult Index()
        {
            ViewBag.getcategoryparent = ProductCatelogy.getListparent() ;
          
            var categorys = from c in data.Categories where c.CategoryParent == 1
                           select  c;
            var viewModel = new DalCategory
            {
                category = categorys.ToList(),
            };
            return View(viewModel);
        }

      
    }
}
